package com.ls.hnks.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.ls.hnks.util.Result;
import com.ls.hnks.service.ScheduleService;
import com.ls.hnks.service.TrainingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SaCheckLogin
@RestController
@RequestMapping("/count")
public class CountController {

    @Autowired
    private TrainingService trainingService;

    @Autowired
    private ScheduleService scheduleService;

    @RequestMapping("/train")
    public Result countTrain(String userId){
        return trainingService.countTrain(userId);
    }

    @RequestMapping("/schedule")
    public Result countSchedule(String groupId){
        return scheduleService.countSchedule(groupId);
    }
}
